\hypertarget{namespaceinput_parser}{\section{Package input\-Parser}
\label{namespaceinput_parser}\index{input\-Parser@{input\-Parser}}
}


Contains the class for file parsing.  


\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
class \hyperlink{classinput_parser_1_1_abstract_input_parser}{Abstract\-Input\-Parser}
\item 
class \hyperlink{classinput_parser_1_1_concrete_parser_factory}{Concrete\-Parser\-Factory}
\begin{DoxyCompactList}\small\item\em Concrete class that implement the factory\-Method of \hyperlink{classinput_parser_1_1_input_parser_factory}{Input\-Parser\-Factory}. \end{DoxyCompactList}\item 
class \hyperlink{classinput_parser_1_1_four_line_input_parser}{Four\-Line\-Input\-Parser}
\begin{DoxyCompactList}\small\item\em Parse a four line grammar format. \end{DoxyCompactList}\item 
class \hyperlink{classinput_parser_1_1_input_parser}{Input\-Parser}
\begin{DoxyCompactList}\small\item\em An object rappresentation of input file parsing result. \end{DoxyCompactList}\item 
class \hyperlink{classinput_parser_1_1_input_parser_factory}{Input\-Parser\-Factory}
\begin{DoxyCompactList}\small\item\em Abstract \hyperlink{classinput_parser_1_1_input_parser_factory}{Input\-Parser\-Factory}. \end{DoxyCompactList}\item 
class \hyperlink{classinput_parser_1_1_l_r_input_parser}{L\-R\-Input\-Parser}
\begin{DoxyCompactList}\small\item\em Parse a txt file with action table, goto table and grammar in one line format ($\ast$.1l). \end{DoxyCompactList}\item 
class \hyperlink{classinput_parser_1_1_single_line_input_parser}{Single\-Line\-Input\-Parser}
\begin{DoxyCompactList}\small\item\em Parse a single line grammar format. \end{DoxyCompactList}\item 
class \hyperlink{classinput_parser_1_1_split_in_symbols}{Split\-In\-Symbols}
\begin{DoxyCompactList}\small\item\em Split the input string in symbols list. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Contains the class for file parsing. Only 2 extension are allowed\-:\par
 1) $\ast$.4l -\/ a file with 4 line that define a grammar\-:\par
 first line -\/$>$ axioms\par
 second line -\/$>$ non-\/terminals\par
 third line -\/$>$ terminals\par
 fourth line -\/$>$ production\par
 example\-: \par
 ////////grammar.4l//////////\par
 E\par
 E, T, P\par
 a, +, x, (, ), \$\par
 E\-:\-:=E+\-T, E\-:\-:=T, T\-:\-:=Tx\-P, T\-:\-:=P, P\-:\-:=a, P\-:\-:=(E)\par
 ///////////////////////////\par


2) $\ast$.1l -\/ a file with 1 line that define a grammar.\par
 the structure may look like this...\par
 S\-:\-:= \{ S\-: T\-E $|$ +\-T\-E; T\-: F\-T $|$ x\-F\-T; E \-: eps; F\-: a $|$ (E)\}\par
 ...where the first element is the axioms and all the element between\par
 the bracket are the production.\par
 This format is pretty convenient associated with Action and Goto table for context-\/free grammar type.\par


You can also parse \char`\"{}.\-txt\char`\"{} file through \hyperlink{classinput_parser_1_1_l_r_input_parser}{L\-R\-Input\-Parser} this type of file may contain the action and goto table and the grammar (written like $\ast$.1l grammar).\par


U\-S\-A\-G\-E\-:\par
 You can obtain the parsing result through the Parser\-Factory that return a proper instance initialized with the result of parsing.\par
 \-: \par
-\/ get a grammar instance from a grammar file\-: \par
 I\-Grammar grammar = (I\-Grammar) new \hyperlink{classinput_parser_1_1_input_parser}{Input\-Parser}(\char`\"{}grammar.\-4l\char`\"{}).parse(); \par
 \par
-\/ get an instance of parser program from a \char`\"{}\-Result.\-txt\char`\"{} file (contains action and goto table and the grammar in $\ast$.1l format)\-: \par
 Parser\-Program \hyperlink{namespaceparser_program}{parser\-Program} = (Parser\-Program) new \hyperlink{classinput_parser_1_1_input_parser}{Input\-Parser}(\char`\"{}\-Result.\-txt\char`\"{}).parse(); 